Class Card

java.lang.Object
  extended by Card

public class Card
extends java.lang.Object

A Card is a playing card from an Anglo-American deck of cards.

Version:
1.1 October 11, 2012, May 24, 2016
Author:
Lynn Marshall, Aly Moursy

Constructor Summary
Card(java.lang.String suit, int rank)
          Constructs a new card with the specified suit and rank.
 
Method Summary
 boolean hasSameRank(Card aCard)
          Determines if this card has the same rank as the specified card.
 boolean isEqualTo(Card aCard)
          Determines if this card is equal to the specified card.
 int rank()
          Returns this card's rank.
 java.lang.String suit()
          Returns this card's suit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Card

public Card(java.lang.String suit,
            int rank)
Constructs a new card with the specified suit and rank.

Method Detail

hasSameRank

public boolean hasSameRank(Card aCard)
Determines if this card has the same rank as the specified card.

Parameters:
a - card
Returns:
true if this card has the same rank as specified card

isEqualTo

public boolean isEqualTo(Card aCard)
Determines if this card is equal to the specified card.

Parameters:
the - specified card.
Returns:
true if cards rank and suit are the same as the specified card

rank

public int rank()
Returns this card's rank.

Returns:
this card's rank.

suit

public java.lang.String suit()
Returns this card's suit.

Returns:
this card's suit.